package com.cskaoyan.shopping.controller;

import com.cskaoyan.mall.commons.result.ResponseData;
import com.cskaoyan.mall.commons.result.ResponseUtil;
import com.cskaoyan.shopping.dto.ProductCateDto;
import com.cskaoyan.shopping.service.IProductCateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author tan
 * @date 2023年01月10日 23:12
 */
@RestController
@RequestMapping("/shopping")
public class CategoriesController {
    @Autowired
    IProductCateService productCateService;

    @GetMapping("/categories")
    public ResponseData categories() {
        List<ProductCateDto> result = productCateService.getAllProductCate("1");
        return new ResponseUtil<>().setData(result);
    }
}
